package edu.scau.mis.pos.domain;

import edu.scau.mis.core.domain.BaseEntity;

import java.math.BigDecimal;
import java.util.Date;
import java.io.Serializable;

/**
 * 商品表(Product)实体类
 *
 * @author Luo
 * @since 2025-03-08 20:15:46
 */
public class Product extends BaseEntity implements Serializable {
    private static final long serialVersionUID = -88059951562717822L;
    /**
     * 商品唯一标识（主键）
     */
    private Long productId;
    /**
     * 商品编号
     */
    private String productSn;
    /**
     * 商品名称（最大支持255字符）
     */
    private String productName;
    /**
     * 分类ID（外键关联product_category表）
     */
    private Long categoryId;

    private String categoryName;
    /**
     * 商品价格（精确到小数点后两位，支持最大值99999999.99）
     */
    private BigDecimal price;
    /**
     * 库存数量（不允许负数）
     */
    private Long stockQuantity;
    /**
     * 商品主图路径（推荐存储相对路径或CDN地址）
     */
    private String productUrl;
    /**
     * 商品详细描述（支持长文本存储）
     */
    private String productDescription;
    /**
     * 商品销售量
     */
    private Long salesQuantity;

    /**
     * 商品创建时间
     */
    private Date createTime;

    /**
     * 商品上架状态（由 SQL 计算得出，1=上架，0=下架）
     */
    private Boolean isAvailable;

    public Category getCategory() {
        return category;
    }

    public void setCategory(Category category) {
        this.category = category;
    }

    private Category category;

    public Product() {}

    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public String getProductSn() {
        return productSn;
    }

    public void setProductSn(String productSn) {
        this.productSn = productSn;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public Long getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Long categoryId) {
        this.categoryId = categoryId;
    }

    public String getCategoryName() { return categoryName; }
    public void setCategoryName(String categoryName) { this.categoryName = categoryName; }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Long getStockQuantity() {
        return stockQuantity;
    }

    public void setStockQuantity(Long stockQuantity) {
        this.stockQuantity = stockQuantity;
    }

    public String getProductUrl() {
        return productUrl;
    }

    public void setProductUrl(String productUrl) {
        this.productUrl = productUrl;
    }

    public String getProductDescription() {
        return productDescription;
    }

    public void setProductDescription(String productDescription) {
        this.productDescription = productDescription;
    }

    public Long getSalesQuantity() {
        return salesQuantity;
    }

    public void setSalesQuantity(Long salesQuantity) {
        this.salesQuantity = salesQuantity;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Boolean getIsAvailable() {
        return isAvailable;
    }

    public void setIsAvailable(Boolean isAvailable) {
        this.isAvailable = isAvailable;
    }



}

